// 引入拦截器配置
import { requestInterceptors, responseInterceptors } from './interceptors';
// 引入 luch-request

// @ts-ignore
import { http } from '@/uni_modules/uview-plus';
// 导入配置文件
import config from '../../config';

// 初始化请求配置
const initRequest = (): void => {
  http.setConfig((defaultConfig: any) => {
    defaultConfig.baseURL = config.baseURL;
    return defaultConfig;
  });

  requestInterceptors(http);
  responseInterceptors(http);
};

export { initRequest };